Skip to content

Variant indexer improvements#1559

Merged
oblodgett merged 2 commits intoSCRUM-5829from
variant_indexer_improvements
Apr 7, 2026
Merged

Variant indexer improvements#1559
oblodgett merged 2 commits intoSCRUM-5829from
variant_indexer_improvements

Conversation

@oblodgett
Copy link
Copy Markdown
Member

No description provided.

Add VariantSearchResultConverter to VariantSummaryCurationIndexer so
low throughput variant HGVS names are indexed and searchable.
@oblodgett oblodgett requested a review from a team as a code owner April 7, 2026 17:18
@oblodgett oblodgett merged commit 5b3d186 into SCRUM-5829 Apr 7, 2026
3 checks passed
@oblodgett oblodgett deleted the variant_indexer_improvements branch April 7, 2026 17:19
@claude
Copy link
Copy Markdown

claude bot commented Apr 7, 2026

Code Review

The PR adds variant search result document indexing logic to VariantSummaryCurationIndexer and then disables the indexer via config. Two issues worth addressing before re-enabling:

Bug: Potential NPE / IndexOutOfBoundsException in converter (VariantSearchResultConverter.java:21)

CuratedVariantGenomicLocationAssociation variantLocation = doc.getVariantList().get(0).getCuratedVariantGenomicLocations().get(0);

This chain will throw NullPointerException if getVariantList() returns null, or IndexOutOfBoundsException if either list is empty. The null check on line 22 only guards the final result, not the intermediate calls. If any VariantSummaryDocument has no variants or no genomic locations, the indexer will crash mid-batch.

Consider guarding against null/empty lists before dereferencing:

if (doc.getVariantList() == null || doc.getVariantList().isEmpty()) continue;
var variant = doc.getVariantList().get(0);
if (variant.getCuratedVariantGenomicLocations() == null || variant.getCuratedVariantGenomicLocations().isEmpty()) continue;
CuratedVariantGenomicLocationAssociation variantLocation = variant.getCuratedVariantGenomicLocations().get(0);

Minor: Commented-out enum entry (IndexerConfig.java:41)

The import for VariantSummaryCurationIndexer was removed but the enum entry was commented out rather than removed. If someone uncomments it later, it won't compile without re-adding the import. Consider either keeping the import or adding a // TODO comment noting the dependency, so it's clear this is intentionally disabled and what's needed to re-enable.

The rest of the converter logic and the dual indexDocuments calls (summary docs to one index, search result docs to another) look correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant